<template>
  <div>
    {{count}}
    <button @click="handleClick">+</button>
  </div>
</template>

<script>
import { computed } from 'vue'
import { useStore } from 'vuex'

export default {
  setup() {
    const store = useStore()

    const handleClick = () => {
      // store.dispatch('add')
      store.commit('addCount')
    }

    return {
      count: computed(() => store.state.count),
      handleClick
    }
  }
}
</script>

<style lang='stylus' scoped>

</style>